const express = require('express');
const UserRouter = express.Router();
const UserController = require('../../controllers/admin/UserController')
// multer 中间件用于处理 form-data 数据（文件上传）
const multer = require('multer')
const upload = multer({ dest: 'public/avataruploads/' })

UserRouter.post('/adminapi/user/login', UserController.login)
UserRouter.post('/adminapi/user/upload', upload.single('file'), UserController.upload)
UserRouter.post('/adminapi/user/add', upload.single('file'), UserController.add)
UserRouter.get('/adminapi/user/list',UserController.list)
UserRouter.get('/adminapi/user/list/:id', UserController.list)
UserRouter.delete('/adminapi/user/:id', UserController.delete)
UserRouter.put('/adminapi/user/:id', UserController.put)
module.exports = UserRouter;